package com.fxp.project.jiuselu.web.models.shareprofit.controller;


import com.fxp.project.jiuselu.web.domain.CommonResult;
import com.fxp.project.jiuselu.web.models.shareprofit.service.IJslShareProfitRecordService;
import com.fxp.project.jiuselu.web.models.shareprofit.request.GetRecord;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.BindingResult;
import org.springframework.web.bind.annotation.*;

/**
 * <p>
 * 分润记录表 前端控制器
 * </p>
 *
 * @author M_
 * @since 2021-12-29
 */
@RestController
@RequestMapping("/v1/shareprofit")
public class JslShareProfitRecordController {

    @Autowired
    private IJslShareProfitRecordService iJslShareProfitRecordService ;


    /**
     * @Description 查询分润纪录   代理管理-二级代理
     * @Date 23:39 2022/1/4
     * @Param [getRecordVo, result]
     * @return com.fxp.project.jiuselu.web.domain.CommonResult
     * @Author M_
     **/
    @PostMapping("/getRecordByUserId")
    @CrossOrigin
    public CommonResult info(@RequestBody GetRecord getRecordVo, BindingResult result) {
        return CommonResult.success(iJslShareProfitRecordService.customManager(getRecordVo));
    }

    //代理管理-二级代理客户
    @PostMapping("/twoClient")
    @CrossOrigin
    public CommonResult twoClient(@RequestBody GetRecord getRecordVo, BindingResult result) {
        return CommonResult.success(iJslShareProfitRecordService.twoClient(getRecordVo));
    }

    //代理管理-二级代理客户
    @PostMapping("/client")
    @CrossOrigin
    public CommonResult client() {
        return CommonResult.success(iJslShareProfitRecordService.client());
    }
}
